<?php

require_once APPLICATION_PATH.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'Component_Abstract.php';

class TextBoxComponent extends Component_Abstract  {
	
	private $_content;

        private function setContent($content) {
		$this->_content=$content;
	}
	
	private function getContent() {
		return $this->_content;
	}
	
	public function initComponent() {
                if (!is_null($this->getParameter('selected_doc_id'))) {
                        $tb = new Default_Model_Documents();
                        $tb->find($this->getParameter('selected_doc_id'));
                        $this->setContent($tb->getContent());
                }
	}
	
	public function show() {
		$content=$this->getContent();
		return $content;
	}

        public function demo() {
            return <<<DEMO
            <div style="width: 20em; height:20em; background-color:red; color:white; border: 1px solid black">This is a demo</div>
DEMO;
        }


        public function getConfigPage() {

            $ret=$this->getTmplContent($this->getConfig()->phtml->configpage);
            return $ret;

        }

        public function getOptionsDiv() {
            
            $ret=$this->getTmplContent($this->getConfig()->phtml->optionspage);
            return $ret;

        }


}
